package com.dyw;

import com.dyw.Ba07.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @auther Devil
 * @create 2022-01-05-22:03
 */
public class MyTest01 {

    /**
     * 根据注解创建再spring容器中创建对象
     */
    @Test
    public void test01() {
        String config = "apllicationContext04.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);
        Student myStudent = (Student) ac.getBean("Student04");

        System.out.println(myStudent.toString());
    }
}
